#pragma once

#include <Plugin.h>
#include <sqlite3.h>
#include <string>

class PluginSQLite : Plugin
{
public:
	PluginSQLite();
	virtual ~PluginSQLite();

	// initialize plugin
	virtual int Init();

	// shutdown plugin
	virtual int Shutdown();

	bool Open(const char* path);
	void Close();
	std::string Exec(const char* exec);

private:
	sqlite3 *m_pDatabase;
	char* m_sError;
};

extern "C" __declspec(dllexport) void *CreatePlugin()
{
	return new PluginSQLite();
}

extern "C" __declspec(dllexport) void ReleasePlugin(void *plugin)
{
	delete static_cast<PluginSQLite*>(plugin);
}